-module(custqrec_service).
-include("rec_dec.hrl").
-include_lib("stdlib/include/qlc.hrl").
-export([start/0,addchange/1,get/0,del/1]).
-define(TAB    , cust_in_q_rec).

start() ->
	case db_mgr:check_table(?TAB) of
	no_found ->
		error_logger:warning_msg("create db table for (~s) with result:~p",
			[?MODULE,
			db_mgr:create_table(?TAB,record_info(fields,?TAB))]),
		ok;
	_ ->
		ok
	end.


addchange(Rec) when is_record(Rec,?TAB) ->
	db_mgr:write(?TAB,Rec).
	
del(ID) -> 
	db_mgr:del(?TAB,ID).

	
get() -> %% get all cust info
	db_mgr:get(?TAB).
	

    
    
    